﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterALSafa.Master" AutoEventWireup="true"
    CodeBehind="BasicPricing.aspx.cs" Inherits="School.Pages.Bus.BasicPricing" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <table align="right" dir="rtl" style="width: 964px">
        <tr>
            <td style="width: 69px">
                &nbsp;
            </td>
            <td>
                <asp:ScriptManager ID="ScriptManager1" runat="server">
                </asp:ScriptManager>
            </td>
        </tr>
        <tr>
            <td colspan="2" nowrap="nowrap">
                <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                    <ContentTemplate>
                        <table align="right" dir="rtl" style="width: 100%; float: right">
                            <tr>
                                <td nowrap="nowrap" style="width: 62px">
                                    المجمع
                                </td>
                                <td>
                                    <asp:DropDownList ID="ddCamp1" runat="server" AppendDataBoundItems="True" AutoPostBack="True"
                                        DataTextField="Name" DataValueField="Id" OnSelectedIndexChanged="ddCamp1_SelectedIndexChanged"
                                        Width="150px">
                                    </asp:DropDownList>
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server" ControlToValidate="ddCamp1"
                                        Display="Dynamic" ErrorMessage="*" ForeColor="Red" InitialValue="-1" ValidationGroup="bu">*</asp:RequiredFieldValidator>
                                </td>
                            </tr>
                            <tr>
                                <td nowrap="nowrap" style="width: 62px">
                                    الباص
                                </td>
                                <td>
                                    <asp:DropDownList ID="ddlbus" runat="server" AppendDataBoundItems="True" DataTextField="Name"
                                        DataValueField="Id" Width="150px">
                                    </asp:DropDownList>
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="ddlbus"
                                        Display="Dynamic" ErrorMessage="*" ForeColor="Red" InitialValue="-1" ValidationGroup="bu">*</asp:RequiredFieldValidator>
                                </td>
                            </tr>
                            <tr>
                                <td nowrap="nowrap" style="width: 62px">
                                    الدورة
                                </td>
                                <td>
                                    <asp:DropDownList ID="ddlcycle" runat="server" AppendDataBoundItems="True" DataTextField="Name"
                                        DataValueField="Id" Width="150px">
                                    </asp:DropDownList>
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ControlToValidate="ddlcycle"
                                        Display="Dynamic" ErrorMessage="*" ForeColor="Red" InitialValue="-1" ValidationGroup="bu">*</asp:RequiredFieldValidator>
                                </td>
                            </tr>
                            <tr>
                                <td nowrap="nowrap" style="width: 62px">
                                    المنطقة
                                </td>
                                <td>
                                    <asp:ListBox ID="LbDistrict" runat="server" DataTextField="Name" DataValueField="Id"
                                        SelectionMode="Multiple" Width="200px" Height="141px"></asp:ListBox>
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator8" runat="server" ControlToValidate="LbDistrict"
                                        ErrorMessage="*" ForeColor="Red" ValidationGroup="bu">*</asp:RequiredFieldValidator>
                                </td>
                            </tr>
                        </table>
                    </ContentTemplate>
                </asp:UpdatePanel>
            </td>
        </tr>
        <tr>
            <td style="width: 69px">
            </td>
            <td>
                <asp:Button ID="btnDisplay" runat="server" OnClick="btnDisplay_Click" Text="عرض"
                    CssClass="graybutton" ValidationGroup="bu" />
            </td>
        </tr>
        <tr>
            <td style="width: 69px">
            </td>
            <td>
                <asp:Literal ID="lbltestBus" runat="server" Visible="False"></asp:Literal>
            </td>
        </tr>
        <tr>
            <td colspan="2" class="admintitle" align="center">
                <asp:Panel ID="plbus" runat="server" Visible="False">
                    <table dir="rtl" style="width: 100%; float: right">
                        <tr>
                            <td colspan="2" class="admintitle" align="center">
                                إضافة محطات للباص
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 69px">
                                &nbsp;
                            </td>
                            <td>
                                <asp:UpdatePanel ID="UpdatePanel3" runat="server">
                                    <ContentTemplate>
                                        <asp:GridView ID="gvstation" runat="server" AlternatingRowStyle-CssClass="GridItemAltername"
                                            AutoGenerateColumns="False" CssClass="Grid" DataKeyNames="Id,District_Id" FooterStyle-CssClass="GridHeaderFooter"
                                            HeaderStyle-CssClass="GridHeaderFooter" PagerStyle-CssClass="GridPager" ShowFooter="True"
                                            Width="100%">
                                            <AlternatingRowStyle CssClass="GridItemAltername" />
                                            <Columns>
                                                <asp:TemplateField>
                                                    <HeaderTemplate>
                                                        م
                                                    </HeaderTemplate>
                                                    <ItemTemplate>
                                                        <%# Container.DataItemIndex + 1 %>
                                                    </ItemTemplate>
                                                </asp:TemplateField>
                                                <asp:BoundField DataField="Name" HeaderText="المحطة" ReadOnly="True" SortExpression="Name">
                                                    <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                                                </asp:BoundField>
                                                <asp:TemplateField HeaderText="السعر الاساسي">
                                                    <FooterTemplate>
                                                        <table dir="rtl" style="width: 100%; float: right">
                                                            <tr>
                                                                <td align="left">
                                                                    <asp:Button ID="btnsave" runat="server" CssClass="graybutton" OnClick="btnsave_Click"
                                                                        Text="حفظ" ValidationGroup="gvs" />
                                                                </td>
                                                            </tr>
                                                        </table>
                                                    </FooterTemplate>
                                                    <ItemTemplate>
                                                        <asp:TextBox ID="txtprice" runat="server">0</asp:TextBox>
                                                        <asp:RequiredFieldValidator ID="RequiredFieldValidator7" runat="server" ControlToValidate="txtprice"
                                                            Display="Dynamic" ErrorMessage="*" ForeColor="Red" ValidationGroup="gvs">*</asp:RequiredFieldValidator>
                                                        <asp:CompareValidator ID="CompareValidator1" runat="server" ControlToValidate="txtprice"
                                                            Display="Dynamic" ErrorMessage="أدخل رقم" ForeColor="Red" Operator="DataTypeCheck"
                                                            Type="Double"></asp:CompareValidator>
                                                    </ItemTemplate>
                                                    <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                                                </asp:TemplateField>
                                            </Columns>
                                            <FooterStyle CssClass="GridHeaderFooter" />
                                            <HeaderStyle CssClass="GridHeaderFooter" />
                                            <PagerStyle CssClass="GridPager" />
                                        </asp:GridView>
                                    </ContentTemplate>
                                </asp:UpdatePanel>
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 69px">
                                &nbsp;
                            </td>
                            <td>
                                <hr />
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2" class="admintitle" align="center">
                                المحطات التابعة للباص
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 69px">
                                &nbsp;
                            </td>
                            <td>
                                <asp:UpdatePanel ID="UpdatePanel2" runat="server">
                                    <ContentTemplate>
                                        <asp:GridView ID="gvprice" runat="server" AllowPaging="True" AlternatingRowStyle-CssClass="GridItemAltername"
                                            AutoGenerateColumns="False" CssClass="Grid" DataKeyNames="Id" FooterStyle-CssClass="GridHeaderFooter"
                                            HeaderStyle-CssClass="GridHeaderFooter" OnPageIndexChanging="gvprice_PageIndexChanging"
                                            OnRowCancelingEdit="gvprice_RowCancelingEdit" OnRowDeleting="gvprice_RowDeleting"
                                            OnRowEditing="gvprice_RowEditing" OnRowUpdating="gvprice_RowUpdating" PagerStyle-CssClass="GridPager"
                                            Width="100%" OnRowDataBound="gvprice_RowDataBound">
                                            <AlternatingRowStyle CssClass="GridItemAltername" />
                                            <Columns>
                                                <asp:TemplateField>
                                                    <HeaderTemplate>
                                                        م
                                                    </HeaderTemplate>
                                                    <ItemTemplate>
                                                        <%# Container.DataItemIndex + 1 %>
                                                    </ItemTemplate>
                                                </asp:TemplateField>
                                                <asp:BoundField DataField="Name" HeaderText="المحطة" ReadOnly="True" SortExpression="Name">
                                                    <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                                                </asp:BoundField>
                                                <asp:TemplateField HeaderText="السعر الأساسي">
                                                    <EditItemTemplate>
                                                        <asp:TextBox ID="txtbprice" runat="server" Text='<%# Bind("Price") %>'></asp:TextBox>
                                                        <asp:RequiredFieldValidator ID="RequiredFieldValidator9" runat="server" ControlToValidate="txtbprice"
                                                            Display="Dynamic" ErrorMessage="*" ForeColor="Red" ValidationGroup="gvp">*</asp:RequiredFieldValidator>
                                                        <asp:CompareValidator ID="CompareValidator2" runat="server" ControlToValidate="txtbprice"
                                                            ErrorMessage="أدخل رقم" ForeColor="Red" Operator="DataTypeCheck" Type="Double"
                                                            ValidationGroup="gvp"></asp:CompareValidator>
                                                    </EditItemTemplate>
                                                    <ItemTemplate>
                                                        <asp:Label ID="Label1" runat="server" Text='<%# Bind("Price")%>'></asp:Label>
                                                    </ItemTemplate>
                                                    <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                                                </asp:TemplateField>
                                                <asp:CommandField CancelText="إلغاء" EditText="تعديل" ShowEditButton="True" UpdateText="تحديث"
                                                    ValidationGroup="gvp">
                                                    <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                                                </asp:CommandField>
                                                <asp:TemplateField ShowHeader="False">
                                                    <ItemTemplate>
                                                        <asp:LinkButton ID="lkdelete" runat="server" CausesValidation="False" CommandName="Delete"
                                                            Text="حذف"></asp:LinkButton>
                                                    </ItemTemplate>
                                                    <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                                                </asp:TemplateField>
                                            </Columns>
                                            <EmptyDataTemplate>
                                                لا توجد بيانات
                                            </EmptyDataTemplate>
                                            <FooterStyle CssClass="GridHeaderFooter" />
                                            <HeaderStyle CssClass="GridHeaderFooter" />
                                            <PagerStyle CssClass="GridPager" />
                                        </asp:GridView>
                                    </ContentTemplate>
                                </asp:UpdatePanel>
                            </td>
                        </tr>
                    </table>
                </asp:Panel>
            </td>
        </tr>
    </table>
</asp:Content>
